package pers.cj.pdos.service;

import org.apache.ibatis.annotations.Param;
import pers.cj.pdos.entity.SaleOrder;
import com.baomidou.mybatisplus.extension.service.IService;
import pers.cj.pdos.entity.SaleOrderGoods;
import pers.cj.pdos.entity.SaleOrderPacket;
import pers.cj.pdos.entity.SaleOrderPacketGoods;
import pers.cj.pdos.vo.PacketVo;
import pers.cj.pdos.vo.SaleOrderVo;

import java.util.Date;
import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author chenj
 * @since 2019-11-04
 */
public interface ISaleOrderService extends IService<SaleOrder> {

    boolean checkNo(String no, String companyId);

    void insert(SaleOrder saleOrder, List<SaleOrderGoods> saleOrderGoodsList,
                List<SaleOrderPacket> saleOrderPacketList,
                List<SaleOrderPacketGoods> saleOrderPacketGoodsList);

    void update(SaleOrder saleOrder, List<SaleOrderGoods> saleOrderGoodsList,
                List<SaleOrderPacket> saleOrderPacketList,
                List<SaleOrderPacketGoods> saleOrderPacketGoodsList);

    List<SaleOrderVo> listVo(String companyId,
                             Integer page,
                             Integer limit,
                             Boolean close,
                             String search,
                             String no,
                             String goodsName,
                             String remark,
                             String custom,
                             Date deliveryDate1,
                             Date deliveryDate2,
                             Date makeTime1,
                             Date makeTime2,
                             String storeId,
                             String userStoreId,
                             String userId,
                             Date date1,
                             Date date2,
                             String makeUserId,
                             Integer status);


    long count(String companyId,
               Boolean close,
               String search,
               String no,
               String goodsName,
               String remark,
               String custom,
               Date deliveryDate1,
               Date deliveryDate2,
               Date makeTime1,
               Date makeTime2,
               String storeId,
               String userStoreId,
               String userId,
               Date date1,
               Date date2,
               String makeUserId,
               Integer status);

    List<SaleOrderVo> listVoByIds(List<String> ids);

    SaleOrderVo getVoById(String id);

    void batchClose(List<SaleOrder> list);

    void batchVerify(String verifyUserId, List<SaleOrder> list);

    void batchBackVerify(List<SaleOrder> list);

    boolean checkClose(SaleOrder saleOrder);
}
